package net.isawesum;

import java.applet.Applet;
import java.applet.AppletContext;
import java.applet.AppletStub;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Properties;

import javax.swing.JFrame;
public class RSLoad implements AppletStub {

    public Properties params;
    public JFrame frame;
    public Applet applet;
    public int random = (int) ( 2 + Math.random() *8);
    public RSLoad() {
	try {
		
		URLClassLoader urlclassloader = new URLClassLoader(new URL[] {	
			new URL("http://world7.runescape.com/loader.jar")
		}); 
	
		applet = (Applet)urlclassloader.loadClass("loader").newInstance();
		params = new Properties();
		applet.setStub(this);
		applet.init();
		applet.start();
	} catch (Exception e) {
	}
    }

    public void appletResize(int i, int j) {
    }

    public final URL getCodeBase() {
	try {
		return new URL("http://world7.runescape.com/");
	} catch (Exception e) {
		return null;
	}
    }

    public final URL getDocumentBase() {
	try {
		return new URL("http://world7.runescape.com/");
	} catch (Exception e) {
		return null;
	}
    }

    public final AppletContext getAppletContext() {
	return null;
    }

    public boolean isActive() {
	return true;
    }

    public String getParameter(String name) {
	params.setProperty("height", "503");
	params.setProperty("width", "765");
	params.setProperty("worldid", "7");
	params.setProperty("members", "1");
	params.setProperty("modewhat", "0");
	params.setProperty("modewhere", "0");
	params.setProperty("lang", "0");

	return params.getProperty(name);
    }
}
